<div class="d-flex justify-content-between align-items-start flex-wrap my-0">
    <!--begin::Title-->
    <h2 class="fw-bold fs-2 my-1">案件</h2>
    <!--end::Title-->
    <!--begin::Controls-->
    <div class="d-flex my-1">
        <a class="btn btn-primary btn-sm" href="{{ admin_route('casecases.create') }}"><i
                class="feather icon-plus"></i>录入案件</a>
    </div>
    <!--end::Controls-->
</div>
@if ($cases->count())
<div class="card cases">
    <div class="card-body py-1">
        <div class="markdown-body editormd-html-preview">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <td scope="col">案件编号</td>
                        <td scope="col">案件名称</td>
                        <td scope="col">委托编号</td>
                        <td scope="col">负责律师</td>
                        <td scope="col">审理次</td>
                        <td scope="col">审判阶段</td>
                        <td scope="col">收入</td>
                        <td scope="col">支出</td>
                    </tr>
                </thead>
                <tbody>
                    @foreach ($cases as $case)
                    <tr>
                        <td>{{$case['id']}}</td>
                        <td><a href="{{ admin_route('casecases.show',[$case['id']]) }}">{{$case['title']}}</a></a>
                        </td>
                        <td>{{$case['case_batch_id']}}</td>
                        <td>{{$case['admin_user_id']}}</td>
                        <td>{{$case['trial_num']}}审</td>
                        <td>
                            @switch($case['trial_step'])
                            @case(0)
                            <span class="badge badge-primary">待立案</span>
                            @break
                            @case(1)
                            <span class="badge badge-secondary">待缴费</span>
                            @break
                            @case(2)
                            <span class="badge badge-danger">待传票</span>
                            @break
                            @case(3)
                            <span class="badge badge-warning">待判决</span>
                            @break
                            @case(4)
                            <span class="badge badge-info">待结案</span>
                            @break
                            @case(5)
                            <span class="badge badge-light">已调解</span>
                            @break
                            @default
                            <span class="badge badge-success">已结案</span>
                            @endswitch
                        </td>
                        <td>{{$case['receipt']}}元</td>
                        <td>{{$case['salesexpenses']}}元</td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>
</div>
@else
<x-blank_tips>
    <x-slot name="title">
        本客户目前没有案件记录
    </x-slot>
    您可以点击右上方录入案件按钮<br>来快速录入案件
</x-blank_tips>
@endif
